package com.google.zxing.client.android.camera;

import java.util.HashMap;
import java.util.Map;

public class CameraConfiguration {
	public static final String KEY_DECODE_1D = "preferences_decode_1D";
	public static final String KEY_DECODE_QR = "preferences_decode_QR";
	public static final String KEY_DECODE_DATA_MATRIX = "preferences_decode_Data_Matrix";
	public static final String KEY_CUSTOM_PRODUCT_SEARCH = "preferences_custom_product_search";

	public static final String KEY_PLAY_BEEP = "preferences_play_beep";
	public static final String KEY_VIBRATE = "preferences_vibrate";
	public static final String KEY_COPY_TO_CLIPBOARD = "preferences_copy_to_clipboard";
	public static final String KEY_FRONT_LIGHT_MODE = "preferences_front_light_mode";
	public static final String KEY_BULK_MODE = "preferences_bulk_mode";
	public static final String KEY_REMEMBER_DUPLICATES = "preferences_remember_duplicates";
	public static final String KEY_SUPPLEMENTAL = "preferences_supplemental";
	public static final String KEY_AUTO_FOCUS = "preferences_auto_focus";
	public static final String KEY_INVERT_SCAN = "preferences_invert_scan";
	public static final String KEY_SEARCH_COUNTRY = "preferences_search_country";

	public static final String KEY_DISABLE_CONTINUOUS_FOCUS = "preferences_disable_continuous_focus";
	// public static final String KEY_DISABLE_EXPOSURE =
	// "preferences_disable_exposure";

	public static final String KEY_HELP_VERSION_SHOWN = "preferences_help_version_shown";

	private static final Map<String, Object> map = new HashMap<String, Object>();

	public static void init(Map<String, Object> map) {
		CameraConfiguration.map.putAll(map);
	}

	public static boolean getBoolean(String key, boolean defValue) {
		Object object = map.get(key);
		if (object == null || !(object instanceof Boolean)) {
			return defValue;
		}
		return (Boolean) object;
	}

	public static String getString(String key, String defValue) {
		Object object = map.get(key);
		if (object == null || !(object instanceof String)) {
			return defValue;
		}
		return (String) object;
	}
}
